package com.spring.aop.xml;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AOPMain {

	
	public static void main(String[] args) {
		System.out.println("saf");
		 //创建spring IOC容器
		ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext-xml.xml");
		//从IOC容器中获取bean实例
		ArithmeticCalculator arithmeticCalculator=applicationContext.getBean(ArithmeticCalculator.class);
		//ArithmeticCalculator arithmeticCalculator=new ArithmeticCalculatorImpl();
		int result=arithmeticCalculator.add(4, 5);
		System.out.println(result);
		
		System.out.println("---------------");
		result=arithmeticCalculator.div(6, 2);
		System.out.println(result);		

//		
//		result=arithmeticCalculator.mul(2, 4);
//		System.out.println(result);
//		
//		result=arithmeticCalculator.sub(10, 3);
//		System.out.println(result);
	}

}
